<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //编写 getAverageAge(users) 函数，该函数获取一个具有 age 属性的对象数组，并返回平均年龄。平均值的计算公式是 (age1 + age2 + ... + ageN) / N。
        var arr = [
            { name: "John", age: 25 },
            { name: "Pete", age: 30 },
            { name: "Mary", age: 28 }
        ];
        // var sum = 0;
        // for (var values of arr) {
        //     sum = sum + values.age;
        // }console.log(sum/arr.length);
    </script>
</body>

</html>